package TeacherLegendAPI.String;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str="abc123def456";
        String arr=str.replaceAll("[0-9]+","#NUMBER#");
        System.out.println(arr);

        String regex="cnm|sb|dsb|lj";
        String message="我cnm，sb东西，超级dsb,死lj";
        message=message.replaceAll(regex,"***");
        System.out.println(message);
    }
}
